#!/bin/sh
# 首先关闭tomcat
sh /opt/tomcat/bin/shutdown.sh
echo "执行关闭tomcat……………………"
# 项目名称
cp /var/lib/jenkins/workspace/zy-webapp-demo-maven/target/zy-webapp-demo.war /opt/tomcat/webapps/
if [ -f "/opt/tomcat/webapps/zy-webapp-demo.war" ];then
    echo "复制zy-webapp-demo.war到/opt/tomcat/webapps/成功"
fi
# 启动并执行
sh /opt/tomcat/bin/startup.sh